package com.yumi.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yumi.entity.PerformanceAppraisal;

import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * 绩效考核服务接口
 */
public interface PerformanceAppraisalService extends IService<PerformanceAppraisal> {

    /**
     * 新增考核记录
     * @param performanceAppraisal 考核记录信息
     * @return 是否添加成功
     */
    boolean addPerformanceAppraisal(PerformanceAppraisal performanceAppraisal);

    /**
     * 修改考核记录
     * @param performanceAppraisal 考核记录信息
     * @return 是否修改成功
     */
    boolean updatePerformanceAppraisal(PerformanceAppraisal performanceAppraisal);

    /**
     * 删除考核记录
     * @param id 考核ID
     * @return 是否删除成功
     */
    boolean deletePerformanceAppraisal(Long id);

    /**
     * 根据ID查询考核详情
     * @param id 考核ID
     * @return 考核记录信息
     */
    PerformanceAppraisal getPerformanceAppraisalById(Long id);

    /**
     * 分页查询考核记录
     * @param page 分页信息
     * @param employeeId 员工ID
     * @param grade 考核等级
     * @return 考核记录分页结果
     */
    Page<PerformanceAppraisal> getPerformanceAppraisalPage(Page<PerformanceAppraisal> page, Long employeeId, String grade);

    /**
     * 获取员工考核历史记录
     * @param employeeId 员工ID
     * @return 员工考核历史列表
     */
    List<PerformanceAppraisal> getEmployeePerformanceHistory(Long employeeId);

    /**
     * 导出绩效考核数据到Excel
     * @param employeeId 员工ID
     * @param grade 考核等级
     * @param response HTTP响应对象
     * @throws IOException IO异常
     */
    void exportToExcel(Long employeeId, String grade, HttpServletResponse response) throws IOException;
} 